﻿using HandyControl.Controls;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using YY.Admin.ViewModels;
using PasswordBox = System.Windows.Controls.PasswordBox;
using Window = HandyControl.Controls.Window;
namespace YY.Admin.Views
{
    /// <summary>
    /// LoginWindow.xaml 的交互逻辑
    /// </summary>
    public partial class LoginWindow : Window
    {
        public LoginWindow()
        {
            InitializeComponent();
            this.Closed += LoginWindow_Closed;
        }

        private void LoginWindow_Closed(object? sender, EventArgs e)
        {
            Application.Current.Shutdown();
        }

        private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
        {
            if (DataContext is LoginViewModel viewModel && sender is PasswordBox passwordBox)
            {
                viewModel.Password = passwordBox.Password;
            }
        }
       
    }
}
